package com.qcl.repository;

import com.qcl.bean.WxOrderRoot;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * 编程小石头：2501902696（微信）
 */
public interface OrderRootRepository extends JpaRepository<WxOrderRoot, Integer> {


    List<WxOrderRoot> findByBuyerOpenidAndOrderStatus(String buyerOpenid, Integer orderStatus, Sort updateTime);

    List<WxOrderRoot> findAll(Specification specification);
//    @Query("SELECT SUM(t2.food_quantity)as foodQuantity, SUM(t1.order_amount) as orderAmount,t1.buyer_address \n" +
//            "FROM wx_order_root t1 LEFT JOIN wx_order_detail t2 ON t1.order_id=t2.order_id \n" +
//            " WHERE t1.create_time BETWEEN ?1 AND ?2 GROUP BY t1.buyer_address")
//    List findDayAll(String startTime,String endTime);
}
